<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Focus Admin: Widget</title>

    <!-- ================= Favicon ================== -->
    <!-- Standard -->
    <link rel="shortcut icon" href="http://placehold.it/64.png/000/fff">
    <!-- Retina iPad Touch Icon-->
    <link rel="apple-touch-icon" sizes="144x144" href="http://placehold.it/144.png/000/fff">
    <!-- Retina iPhone Touch Icon-->
    <link rel="apple-touch-icon" sizes="114x114" href="http://placehold.it/114.png/000/fff">
    <!-- Standard iPad Touch Icon-->
    <link rel="apple-touch-icon" sizes="72x72" href="http://placehold.it/72.png/000/fff">
    <!-- Standard iPhone Touch Icon-->
    <link rel="apple-touch-icon" sizes="57x57" href="http://placehold.it/57.png/000/fff">

    <!-- Styles -->
    <link href="assets/css/lib/font-awesome.min.css" rel="stylesheet">
    <link href="assets/css/lib/themify-icons.css" rel="stylesheet">
    <link href="assets/css/lib/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/lib/helper.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">

    <script src="js/jquery-3.5.1.js"></script>
    <script src="js/jquery.md5.js"></script>

    <script>
        $(document).ready(function () {
            $("#submit").click(function () {
                var requestObj = {};
                requestObj["requestService"] = "login";
                requestObj["requestMethod"] = "";
                var data = {};
                data["userName"] = document.getElementById("userName").value;
                var passwordMD5 = $.md5(document.getElementById("password").value);
                data["password"] = passwordMD5.toUpperCase();
                requestObj["data"] = data;
                var requestJson = JSON.stringify(requestObj)
                $.ajax({
                    type: "POST",
                    url: "http://192.168.70.135:80/identify/",
                    contentType: "application/json",
                    data: requestJson,
                    success: function (msg) {
                        window.location.href="index.html"
                    },
                    error: function (msg) {
                        alert("登陆失败：" + msg.responseJSON.data[0].errorMessage);
                    }
                });
            })
        })
    </script>
</head>

<body class="bg-primary">
    <div class="unix-login">
        <div class="container-fluid">
            <div class="row justify-content-center">
                <div class="col-lg-6">
                    <div class="login-content">
                        <div class="login-logo">
                            <a href="index.html"><span>个体商户商品管理系统</span></a>
                        </div>
                        <div class="login-form">
                            <h4>登陆</h4>
                            <div class="form-group">
                                <label>用户名</label>
                                <input id="userName" type="text" class="form-control" placeholder="在此处输入用户名">
                            </div>
                            <div class="form-group">
                                <label>密码</label>
                                <input id="password" type="password" class="form-control" placeholder="在此处输入密码">
                            </div>
                            <button id="submit" class="btn btn-primary btn-flat m-b-30 m-t-30">确定</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</body>

</html>